/*******************************************************************************
COPYRIGHT 2012   : ATECH
Project          : 
Source File Name : drv_can.h
Group            : SoftWare Team
Author           : 
Date First Issued: 02/01/2013
********************************Documentation**********************************
Purpose -  This file is HCS12 CAN driver header file
********************************RevisionHistory********************************
_______________________________________________________________________________
Date : MM/DD/YY    Release        Changes Description                  Author
Date : 09/06/2012    1.0                                                 
   
******************************************************************************/ 

#ifndef	drv_can_h
#define	drv_can_h


/* #include */
#include "sys_micro.h"
#include "system.h"
#include "msg_canType.h"
#include "drv_canCfg.h"
#include "drv_canCbk.h"
#include "msg_canList.h"


/* Function prototypes */ 
    /* MSCAN module configuration */
void drv_can_v_intConfig(CAN_INT_CONGIF_CMD_E e_CMD, BOOL b_status);    
CAN_STATE_E drv_can_v_init(void) ;
CAN_STATE_E drv_can_e_sleep(void);
CAN_STATE_E drv_can_e_wakeUp(void);
CAN_STATE_E drv_can_e_test(void) ;
CAN_STATE_E drv_can_e_sendFrame(UINT32 u32_id, UINT8 u8_prio, UINT8 u8_length, UINT8 *p_u8_txData);
CAN_BUS_STATE_E drv_can_e_getBusStatus(void);
void drv_can_v_recoverFromBusOff(void);
BOOL drv_can_b_getSleepSts(void);

void drv_can_v_clearTxBuffer(void);

void drv_can_v_getMessage(DRV_CAN_MSG_S *p_st_message);
UINT8 drv_can_u8_getRxMessageCount(void);

#if( CAN_RX_FAST == TRUE )
void drv_can_v_getFastMessage(DRV_CAN_MSG_S *p_st_message);
UINT8 drv_can_u8_getRxFastMessageCount(void);
#endif

#pragma CODE_SEG __NEAR_SEG NON_BANKED

__interrupt void drv_can_v_txISR(void);
__interrupt void drv_can_v_rxISR(void); 
__interrupt void drv_can_v_errorISR(void); 
__interrupt void drv_can_v_wakeUpISR(void); 

#pragma CODE_SEG DEFAULT


#endif

/***********************end of drv_can.h******************************************/

/******************************************************************************
 Revision Notes:

For each change to this file, be sure to record:
1. Who made the change and when the change was made.
2. Why the change was made and the intended result.

  Date     By     Reason For Change
mm/dd/yy  XXX     -----------------

******************************************************************************/



